package com.learning.dubbo.service.generic.provider;

import com.learning.dubbo.service.generic.api.GreetingsService;

/**
 * ClassName: Consumer
 * Description: 泛化接口
 * Date: 2020/6/15 13:43 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class GreetingsServiceImpl implements GreetingsService {

    @Override
    public String sayHello(String name) {
        return "Welcome " + name;
    }

    @Override
    public Object $invoke(String methodName, String[] parameterTypes, Object[] args) {
        if ("sayHello".equals(methodName)) {
            return sayHello((String) args[0]);
        }
        return null;
    }
}